#!/usr/bin/env python
# -*- coding: utf-8 -*-
# @Time    : 2021/11/20 7:50
# @Author  : huidong.bai
# @File    : test.py
# @Software: PyCharm


import psutil


def run():
    while True:
        for item in psutil.disk_partitions():
            if "removable" in item.opts:
                print("U盘插入")
            else:
                print("U盘拔出")


if __name__ == "__main__":
    run()
